﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Admin_AdminMasterPage : System.Web.UI.MasterPage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Helper.logIn())
        {
            Response.Redirect("/eprojectAirlinesReservationSystem/Default.aspx");
        }
        if (this.getUser()._roleID != "1")
        {
            Response.Redirect("/eprojectAirlinesReservationSystem/Default.aspx");
        }
    }
    public UserEntities getUser()
    {
        UserEntities item = (UserEntities)Session["user"];
        return item;
    }
    protected void btnLogout_Click(object sender, EventArgs e)
    {
        Session["user"] = null;
        Response.Redirect("/eprojectAirlinesReservationSystem/Default.aspx");
    }
}
